AssetWise Implementation Guide

Syntax for the Mask

SettingDescription
Single quote (') is used for encapsulating literal text to include in the results.
Plus sign (+) is used to concatenate items.
Note: The + does not show in the final result.

Examples

Assuming Code = D17, Revision = 1, attribute a1 = ABC, attribute a2 = DEF

Code + '-' + Revision results in D17-1

Code + '*' + Revision results in D17*1

Attributes["Global", "a1"].Value + Attributes["Global", "a2"].Value results in ABCDEF

  • Literal values are required to be in single quotes, including numeric, alphabetic, and date placeholders (#,$).

    'ABC####$' = ABC0001A

    'PRJ-' + '####' results in PRJ-0001

    'PRJ+' + '####' results in PRJ+0001 (Notice that the plus sign is displayed in the result since it is defined in single quotes)

  • Numbers must be cast to strings using the CAST(<value> AS STRING) syntax.

    CAST(Id as STRING) results in 1 (assuming Id = 1)

  • Dates must be cast to string using the CAST(<value> AS STRING, [AdditionalFormatting])

    [AdditionalFormatting] should be supplied or the format will depend on the local settings:

    Accepts combinations of dd, ddd, dddd, MM, MMM, MMMM, yy, yyyy (which are case sensitive) so that:

    dd => 01
    ddd => We 
    dddd => Wednesday 
    MM => 02 
    MMM => Feb
    MMMM => February
    yy => 12
    yyyy => 2012 

    CAST(AuditDetails.AuditDate AS STRING) = AUG 13 2013 4:21PM

    CAST(AuditDetails.AuditDate AS STRING, 'MMddyyyy') = 08132013

  • Any value that may not exist should be given an alternative using the IFNULL(<term>, <alternative>) syntax. The calculation returns an empty value for the number if any part of the expression doesn't exist, and then reverts to the system default mask instead of using the calculated mask.

Code + IFNULL(Revision, '') results in 0001

  • Question marks can be used to indicate incomplete values. After the properties of the object are filled in and the number is recalculated, the question mark will be replaced with the appropriate value. Use in conjunction with IFNULL.

Code + IFNULL(Revision, '?') results in 0001?

  • Attribute syntax is Attributes["<Scope>", "<AttributeName>"].Value. The scope and attribute name are required to determine the attribute value to display but are not displayed in the final result.

Attributes["Global", "a1"].Value results in ABC (assuming the attribute 'a1' in the 'Global' scope has a value of 'ABC')

  • The following are additional examples of valid expressions:

UPPER ( Expression ) - Forces all text to uppercase

LOWER ( Expression ) - Forces all text to lowercase

LENGTH ( Expression ) - Gives the length of the text expression

LEFT ( Expression, Integer ) - Gives the text starting on the left, for a length of <Integer>

RIGHT ( Expression, Integer ) - Gives the text starting on the right, for a length of <Integer>

SUBSTRING ( Expression, S_Integer, E_Integer ) - Gives the text from the <S_Integer> position through the <E_Integer> position

POSITION ( Find_Expression, Source_Expression) - Gives the starting position of the specified Find text in Source text

REPLACE ( Source_Expression, Old_Expression, New_Expression ) - Replaces all occurrences of the specified Old text in the Source text with the New text

TRIM ( Expression ) - Removes all leading and trailing spaces in the text

CASE ( Input_Expression ) – Evaluates a list of conditions and gives one of multiple possible result text

Example:

CASE Input_expression
 WHEN When_expression 
 THEN ouput1_expression 
 ELSE output2_expression 
 END